<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        /*
           string- replace
           string- match
           /--/.test(string)
        */
        let str = "1abccb2";
        console.log(/\d/.test(str)); //true
        console.log(/^\d/.test(str)); //true
        console.log(/^\d$/.test(str)); //false
        console.log(/^1abccb2$/.test(str)); //true
    </script>
</body>

</html>